Devices may outlive the corresponding menu item, for example on
shutdown. Make sure that signals are disconnected correctly in
that case to avoid warnings.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8223
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3669>
this.connect('destroy', () => (this._spinner = null));
this.connect('activate', () => this._toggleConnected().catch(logError));
- this._device.connect('notify::alias', () => this._updateAccessibleName());
- this._device.connect('notify::connected', () => this._updateAccessibleName());
+ this._device.connectObject(
+ 'notify::alias', () => this._updateAccessibleName(),
+ 'notify::connected', () => this._updateAccessibleName(),
+ this);
this._updateAccessibleName();
}